package com.dex4d.ui.mine.fragment;

import android.support.v4.app.Fragment;
import android.view.View;

import com.dex4d.R;
import com.dex4d.core.AppBaseActivity;
import com.dex4d.core.AppToolBarBaseActivity;
import com.dex4d.core.AppToolbarBaseFragment;
import com.dex4d.core.ITabFragment;
import com.dex4d.ui.mine.activity.AuthorityActivity;
import com.dex4d.ui.mine.activity.SettingActivity;
import com.dex4d.widgets.SimpleListItem;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by chengyuchun on 2018/11/2.
 *
 * 控件命名规则，控件缩写_业务名称，即保持xml里命名一致，能有效增加开发效率
 */
public class TabMineFragment extends AppToolbarBaseFragment implements ITabFragment {
    @BindView(R.id.sli_setting)
    SimpleListItem sli_setting;

    @BindView(R.id.sli_authority)
    SimpleListItem sli_authority;

    @BindView(R.id.sli_about)
    SimpleListItem sli_about;

    @Override
    protected void initToolbar(AppToolBarBaseActivity mContent) {
        super.initToolbar(mContent);
        mContent.showTitle(getString(R.string.home_tab_me));
        mContent.getToolbarRight().setVisibility(View.GONE);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_tab_mine;
    }

    @Override
    protected void initVariables() {

    }

    @Override
    protected void loadData() {

    }

    @Override
    public void onMenuItemClick() {

    }

    @OnClick({R.id.sli_setting,R.id.sli_authority,R.id.sli_about})
    public void onViewClick(View view){
        switch (view.getId()){
            case R.id.sli_setting:
                ((AppBaseActivity)mContext).openActivity(SettingActivity.class);
                break;
            case R.id.sli_authority:
                ((AppBaseActivity)mContext).openActivity(AuthorityActivity.class);
                break;

            case R.id.sli_about:

                break;
        }
    }

    @Override
    public Fragment getFragment() {
        return this;
    }

    @Override
    public String getTitle() {
        return null;
    }
}
